<section id="">
    <div class="container">
        <div class="row">
            <div class="span12">	            	
                <ul class="breadcrumb">
                    <li class="previous"><a href="<?php echo SITE_URL; ?>">Home /</a></li>                
                    <li class="disable"><a href="javascript:void(0);">Teach</a></li>
                </ul>  

                <div class="common blueBg radius4px">
                    <div class="padding56 alignC">
                        <h5 class="remmargin txtfff fnt-size36 addpaddingB30">Teach</h5>
                        <p class="txtfff fnt-size18 font-opensanslt">Create your profile and a well structured class with our free and easy to use sign up process.</p>
                        <p class="txtfff fnt-size18 font-opensanslt">Use our growing community to market your class and interact with students as we work to simplify & secure your cash collection process.<p>
                        <p class="txtfff fnt-size18 font-opensanslt addpaddingB20">Leaving you to focus on one important aspect... teaching!</p>
                        <?php
                        $userId = getLoginUserId();
                        if (!empty($userId)) {
                            ?>
                            <a href="javascript:void(0)" class="btn addmarginB10" onclick="checkProfile('Classes/Create');">Create a Class </a>
                            <a href="javascript:void(0)" class="btn  addmarginB10" onclick="checkProfile('Courses/Create');">Create a Course</a>
                            <a href="<?php echo $this->createAbsoluteUrl('/user/profile/mySkillhippo'); ?>" class="btn addmarginB10">My SkillHippo</a>
                            <div id="AjaxLoader" style="display:none;" align="center">&nbsp;<img src="<?php echo ThemePath(); ?>/images/fancybox_loading@2x.gif" align="absmiddle"></div>
                            <div id="formResult" class="errorMessage"></div>                       
                        <?php } else { ?>
                            <a href="<?php echo $this->createAbsoluteUrl('/user/user/registration/'); ?>" class="btn" onclick="setSessionForTrainer(<?php echo SkillConfig::USER_TRAINER; ?>);">Create a Profile</a><?php } ?>


                    </div>               		                           
                </div>

            </div>
        </div>
    </div>
</section>
<div class="padding20px"></div>
<?php
$allClassCourseInfo = array();
$classDetails = literalEndingTommorow('', '', '');
$courseDetails = runningCurrentCoursesByUser('', '', ''); //Null parameter means these value $profiles, $userType, $getValue)
$allClassCourseInfo = array_merge($classDetails, $courseDetails);
usort($allClassCourseInfo, 'date_compare');
$validatedata = literalendingtommorowValiadte($allClassCourseInfo);
if (!empty($validatedata)) {
    $this->renderPartial('/classes/literallyEndingtomorrow', array('allClassCourseInfo' => $allClassCourseInfo));
}
?>
<script>   
    jQuery(document).ready(function($) {
        $('.crsl-items1').respCaro({overflow: false, visible: 3, itemMinWidth: 300, itemMargin: 20, autoRotate: 4000});
        $('.crsl-items2').respCaro({overflow: false, visible: 3, itemMinWidth: 300, itemMargin: 20, autoRotate: 5000});
    });

    function checkProfile(action) {
        jQuery.ajax({
            'type': 'POST',
            'url': "<?php echo Yii::app()->createAbsoluteUrl("user/profile/checkProfile"); ?>",
            'data': 'action=' + action,
            'beforeSend': function(jqXHR, settings) {
                $("#AjaxLoader").show();
            },
            'success': function(data) {             
                $("#AjaxLoader").hide();
                if (data == 1) {                
                    $("#formResult").text("Frist complete your profile.");
                   
                    window.setTimeout(function() {
                        $("#AjaxLoader").show();
                        window.location.href = '<?php echo Yii::app()->createAbsoluteUrl("user/profile/updateprofile"); ?>';
                    }, 5000);
                }
                else {
                    window.location.href = data;
                }
            },
            'cache': false
        });
    }
</script>